#include <iostream>
#include <string>
using namespace std;

class Employee
{
protected:
  string name;
  int id;
  int level;
  float monthlySalary;

public:
  Employee(string name, int id)
  {
    this->name = name;
    this->id = id;
    this->level = 1;
    this->monthlySalary = 0;
  }

  void display()
  {
    cout << "姓名：" << name << endl;
    cout << "编号：" << id << endl;
    cout << "级别：" << level << endl;
    cout << "当月薪水：" << monthlySalary << "元" << endl;
  }
};

class Manager : public Employee
{
public:
  Manager(string name, int id) : Employee(name, id)
  {
    monthlySalary = 8000;
  }
  void promote()
  {
    level = 4;
  }
};

class Technician : public Employee
{
private:
  int workedHours;

public:
  Technician(string name, int id) : Employee(name, id)
  {
    monthlySalary = 0;
    workedHours = 0;
  }

  void setWorkedHours(int hours)
  {
    workedHours = hours;
    monthlySalary = workedHours * 100;
  }
  void promote()
  {
    level = 3;
  }
};

class Salesman : public Employee
{
private:
  float salesAmount;

public:
  Salesman(string name, int id) : Employee(name, id)
  {
    monthlySalary = 0;
    salesAmount = 0;
  }

  void setSalesAmount(float amount)
  {
    salesAmount = amount;
    monthlySalary = salesAmount * 0.04;
  }
  void promote()
  {
    level = 1;
  }
};

class SalesManager : public Employee
{
private:
  float salesAmount;

public:
  SalesManager(string name, int id) : Employee(name, id)
  {
    monthlySalary = 5000;
    salesAmount = 0;
  }

  void setSalesAmount(float amount)
  {
    salesAmount = amount;
    monthlySalary += salesAmount * 0.005;
  }
  void promote()
  {
    level = 3;
  }
};

int main()
{
  // 创建员工对象
  Manager manager("经理", 1);
  Technician technician("技术人员", 2);
  Salesman salesman("销售员", 3);
  SalesManager salesManager("销售部经理", 4);

  // 设置员工的相关信息
  technician.setWorkedHours(80);
  salesman.setSalesAmount(20000);
  salesManager.setSalesAmount(50000);

  // 显示员工信息
  cout << "经理信息：" << endl;
  manager.display();
  cout << endl;

  cout << "技术人员信息：" << endl;
  technician.display();
  cout << endl;

  cout << "销售员信息：" << endl;
  salesman.display();
  cout << endl;

  cout << "销售部经理信息：" << endl;
  salesManager.display();
  cout << endl;

  // 提升级别
  manager.promote();
  technician.promote();
  salesManager.promote();

  // 显示提升后的员工信息
  cout << "提升后的经理信息：" << endl;
  manager.display();
  cout << endl;

  cout << "提升后的技术人员信息：" << endl;
  technician.display();
  cout << endl;

  cout << "提升后的销售员信息：" << endl;
  salesman.display();
  cout << endl;

  cout << "提升后的销售部经理信息：" << endl;
  salesManager.display();
  cout << endl;

  return 0;
}